package d01014;

import java.util.Random;

public class MineMap {
    private int height;//高度 -->rows
    private int width;//宽度 -->col
    private int mineCount;//雷的数量
    public MineMap()
    {

    }
    public MineMap(int height, int width, int mineCount) {
        this.height = height;
        this.width = width;
        this.mineCount = mineCount;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getMineCount() {
        return mineCount;
    }

    public void setMineCount(int mineCount) {
        this.mineCount = mineCount;
    }
    public Point[][] getMineMap(){
        Point[][] points = new Point[height][width];
        //初始化的操作，主要就是创建棋子对象并记录对象坐标
        for(int i=0;i<height;i++){
            for(int j=0;j<width;j++){
                points[i][j] = new Point(i,j,0);
            }
        }
        return burnMine(points);
    }

    private Point[][] burnMine(Point [][] points){
        Random rd = new Random();
        for(int i=0;i<mineCount;){
            int x = rd.nextInt(height);
            int y = rd.nextInt(width);
            //
            //
            if ( (points[x][y].getState()& 0b1)!=0b1 ){

            }
        }








        return points;
    }
}

